package Service.Impl;
import Dao.SysInfoTypeDao;
import Model.SysInfo;
import Model.SysInfoType;
import Dao.SysInfoDao;
import Service.SysInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("sysInfoService")
public class SysInfoServiceImpl implements SysInfoService {
    //调用Dao层
    @Autowired
    private SysInfoDao sysInfoDao;

    @Autowired
    private SysInfoTypeDao sysInfoTypeDao;


    //查询
    @Override
    public List<SysInfo> selectByOperator(String user_id, String operType,String timeStart, String timeEnd){
        System.out.println("进入service层");
        return sysInfoDao.selectByOperator(user_id,operType,timeStart,timeEnd);
    }

    @Override
    public List<SysInfo> logList() {
        return this.sysInfoDao.findList();
    }

//创建列表
    @Override
    public  int insert(SysInfo sysInfo){
        return sysInfoDao.insert(sysInfo);
    }

    //日志类型
    @Override
    public List<SysInfoType> getAllLogType() {
        return this.sysInfoTypeDao.getAllLogType();
    }

    @Override
    public SysInfoType getLogTypeContextByMethodName(String methodName) {
        return sysInfoTypeDao.getLogTypeContextByMethodName(methodName);
    }

    //    获取用户登录时间
    @Override
    public List<SysInfo> getLogTime(String user_id){
        return sysInfoDao.getLogTime(user_id);
    }

}
